package com.chengqj.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.chengqj.dao.IUserDao;
import com.chengqj.dao.TArticleMapper;
import com.chengqj.pojo.TArticle;
import com.chengqj.pojo.User;
import com.chengqj.service.IMainService;

@Service("mainService")
public class MainServiceImpl implements IMainService {
	@Resource
	private IUserDao userDao;

	@Resource
	private TArticleMapper articleMapper;

	@Override
	public User getUserById(int userId) {
		return this.userDao.selectByPrimaryKey(userId);
	}

	@Override
	public TArticle getArticleById(int id) {
		return this.articleMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<TArticle> selectByType(TArticle ta) {
		return this.articleMapper.selectByType(ta);
	}

	@Override
	public int insert(TArticle record) {
		return articleMapper.insert(record);
	}

	@Override
	public List<TArticle> selectSySy() {
		return articleMapper.selectSySy();
	}

}
